<template>
  <div class="sidebar">
    <div class="logo">
      <img src="@/assets/logo.png" alt="Logo" />
      <h2>天台茶旅</h2>
    </div>
    
    <div class="menu">
      <div class="menu-item active">
        <i class="icon dashboard"></i>
        <span>数据中心</span>
      </div>
      <div class="menu-item">
        <i class="icon users"></i>
        <span>用户管理</span>
      </div>
      <div class="menu-item">
        <i class="icon orders"></i>
        <span>订单管理</span>
      </div>
      <div class="menu-item">
        <i class="icon products"></i>
        <span>商品管理</span>
      </div>
      <div class="menu-item">
        <i class="icon settings"></i>
        <span>系统设置</span>
      </div>
    </div>
    
    <div class="footer">
      <div class="theme-switch">
        <span>深色模式</span>
        <div class="switch"></div>
      </div>
      <div class="logout">
        <i class="icon logout"></i>
        <span>退出登录</span>
      </div>
    </div>
  </div>
</template>

<script setup>
// Sidebar component logic can go here
</script>

<style scoped>
.sidebar {
  width: 250px;
  background: #333;
  color: white;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 20px;
}

.logo {
  display: flex;
  align-items: center;
  margin-bottom: 40px;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.logo img {
  width: 40px;
  height: 40px;
  margin-right: 10px;
}

.logo h2 {
  font-size: 18px;
  font-weight: 600;
  margin: 0;
}

.menu {
  flex: 1;
}

.menu-item {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  margin-bottom: 8px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.3s;
}

.menu-item:hover {
  background: rgba(255, 255, 255, 0.1);
}

.menu-item.active {
  background: #4a80ff;
}

.icon {
  width: 20px;
  height: 20px;
  margin-right: 12px;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 4px;
  display: inline-block;
}

.footer {
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.theme-switch {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.switch {
  width: 40px;
  height: 20px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  position: relative;
  cursor: pointer;
}

.switch::before {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  background: white;
  border-radius: 50%;
  top: 2px;
  left: 2px;
  transition: transform 0.3s;
}

.logout {
  display: flex;
  align-items: center;
  cursor: pointer;
  padding: 12px 16px;
  border-radius: 6px;
}

.logout:hover {
  background: rgba(255, 255, 255, 0.1);
}
</style> 